# $ID$
# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname=perl-unicode-linebreak
_dist=Unicode-LineBreak
pkgver=2017.004
pkgrel=2
pkgdesc="UAX #14 Unicode Line Breaking Algorithm"
arch=('x86_64')
url="https://metacpan.org/release/${_dist}"
license=('PerlArtistic' 'GPL')
depends=('perl' 'perl-mime-charset' 'libthai')
checkdepends=('perl-test-pod')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/N/NE/NEZUMI/${_dist}-${pkgver}.tar.gz)
# Checksums from https://cpan.metacpan.org/authors/id/N/NE/NEZUMI/CHECKSUMS
md5sums=('de7672227922260ac92d20bbad29660b')
sha256sums=('655bc3c4cb60ad0770d97816716cfe322f24e602c70e595f5941dfa02c40cb76')

build() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
